import { SongInfo } from '@/model/songInfo'

export class SongInfoUtil {
    public static songList: SongInfo[] = [
        new SongInfo('Kitsch', 'kitsch.mp3', 'kitsch.jpg', 1),
        new SongInfo('光るなら', 'guangGooseHouse.mp3', 'guangGooseHouse.jpg', 2),
        new SongInfo('好想爱这个世界啊', 'haoxiangaizhegeshijiea.mp3', 'haoxiangaizhegeshijiea.jpg', 3)
    ]

    public static getSongListByLevel(level: number) {
        if (level == 0) {
            return this.songList
        } else {
            const newSongList: Array<SongInfo> = new Array<SongInfo>()
            this.songList.forEach(songInfo => {
                if (songInfo.level == level) {
                    // console.info(JSON.stringify(songInfo))
                    newSongList.push(songInfo)
                    // console.info(JSON.stringify(newSongList))
                }
            })
            return newSongList
        }
    }
}
